package view;

public class V_Utilities
{
  // checks bounds for x or y 
  // because we don't know which one (s1 or s2)  is greater than which we need to use this approach.
  static boolean inBounds(float s1, float s2, float d)
  {
    if(d > s1 && d < s2 || d < s1 && d > s2)
      return true;
    else return false;
  }
  
  // a handy contains method for symmetrical contains checks 
  static boolean contains(float x1, float y1, float x2, float y2, float boundingBox)
  { // x1 = the target value (eg: object) // x2 = the input value (eg: mouse position) // boundingBox = precision
    if (x2 < x1 + boundingBox && x2 > x1 - boundingBox 
      && y2 < y1 + boundingBox && y2 > y1 - boundingBox)
    {
      return true;
    }
    else return false;
  }
}
